<?php

class Objetos {


  static public function _toArray($rs,$id = false,$text = false) {
    $rss = array();
    if ($rs) {
      foreach ($rs as $r) {
        $rss[($id)?$r->$id():$r->getId()] = ($text) ? $r->$text() : $r ;
      }
    }
    return $rss;
  }
  static public function _toIdArray($rs,$id = "getId") {
    $rss = array();
    if ($rs) {
      foreach ($rs as $r) {
        $rss[] = $rs->$id();
      }
    }
    return $rss;
  }

}
?>
